package two_shape;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Ellipse;
import javafx.stage.Stage;

/**
 * 椭圆形
 */
public class EllipseExample extends Application {
    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Shape Example");
        Group group = new Group();
        Ellipse ellipse = new Ellipse();
        //椭圆中心的水平位置
        ellipse.setCenterX(100);
        //椭圆中心的垂直位置
        ellipse.setCenterY(100);
        //椭圆的宽度
        ellipse.setRadiusX(50);
        //椭圆的高度
        ellipse.setRadiusY(80);
        group.getChildren().add(ellipse);
        Scene scene = new Scene(group, 200, 300, Color.GRAY);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
